package com.moon.fragment;

import java.util.ArrayList;
import java.util.List;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.Toast;

import com.actionbarsherlock.app.SherlockFragment;
import com.moon.R;
import com.moon.adapter.FoundAdapter;
import com.moon.constants.MoonConstants;
import com.moon.model.FoundModel;

public class FoundFragment extends SherlockFragment {

    private ListView      foundListView;
    private FoundAdapter adapter;

    private View          view;

    public static FoundFragment newInstance() {
        FoundFragment foundFragment = new FoundFragment();
        return foundFragment;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.blank1, null);
//        view = inflater.inflate(R.layout.found_fragment, null);
//
//        foundListView = (ListView) view.findViewById(R.id.found_list_view);
//        foundListView.setOnItemClickListener(new OnItemClickListener() {
//
//            @Override
//            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//                //这里要利用adapter.getItem(position)来获取当前position所对应的对象
//                Toast.makeText(getActivity(), "OK", Toast.LENGTH_SHORT).show();
//            }
//        });
//
//        adapter = new FoundAdapter(getActivity(), getDatas());
//        foundListView.setAdapter(adapter);

        return view;
    }

    /**
     * 
     */
    private List<FoundModel> getDatas() {
        List<FoundModel> list = new ArrayList<FoundModel>();
        FoundModel model = new FoundModel();
        model.setTitle("邻居圈");
        model.setImgSrc(MoonConstants.MOON_DOMAIN_STATIC+"/imgs/found_linjuquan.jpg");
        list.add(model);
        FoundModel model1 = new FoundModel();
        model1.setTitle("扫一扫");
        model1.setImgSrc(MoonConstants.MOON_DOMAIN_STATIC+"/imgs/ofm_qrcode_icon.png");
        list.add(model1);
        
        return list;
    }

}


